home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / datatypes / jpegdt / jpeg.datatype.install < prev    next >
Text File  |  1996-04-07  |  3KB  |  123 lines

  1. ; JPEG Datatype Installer Script
  2. ; $VER: JPEG.datatype.install 39.1 (28/07/93)
  3. ;
  4.  
  5. ; First make sure we have WB3.0
  6. (set @default-dest "")
  7. (if (< (/ (getversion) 65536) 39)
  8. (
  9.   (abort "You must have at least Workbench 3.0")
  10. ))
  11.  
  12. ; Now check for at least a 68020 processor
  13. (set proc (database "cpu"))
  14. (if (OR (= proc "68000") (= proc "68010"))
  15. (
  16.   (abort "You must have at least a 68020 processor")
  17. ))
  18.  
  19. ; Check that the datatypes directory exists
  20. (if (NOT (exists "SYS:classes/datatypes"))
  21. (
  22.   (abort "Can't find the SYS:classes/datatypes directory")
  23. ))
  24.  
  25. ; Copy the datatype to it
  26. (copyfiles
  27.   (prompt "")
  28.   (help @copyfiles-help)
  29.   (source "JPEG.datatype")
  30.   (dest "SYS:classes/datatypes")
  31. )
  32.  
  33. ; Find out what sort of installation this is
  34. (set choice (askchoice
  35.   (prompt "Install as permanently enabled, or manually selectable")
  36.   (choices "Permanently enabled" "Manual select")
  37.   (help
  38.     (cat "The datatype can be installed as permanently enabled, or"
  39.          " manually selectable.\n\n"
  40.          "Pemanently enabled means that the datatype is always ready for use.\n"
  41.          "Manually Selectable means that the datatype has to be run before"
  42.          "it can be used.  Once it has been run, it remains installed until "
  43.          "the computer is rebooted."))
  44. ))
  45.  
  46. (if (= choice 0)
  47. (
  48.   ; Permanent installation
  49.   ; Check that the datatypes directory exists
  50.   (if (NOT (exists "DEVS:datatypes"))
  51.   (
  52.     (abort "Can't find the DEVS:datatypes directory")
  53.   ))
  54.  
  55.   ; Copy the datatype to it
  56.   (copyfiles
  57.     (prompt "")
  58.     (help @copyfiles-help)
  59.     (source "JPEG")
  60.     (infos)
  61.     (dest "DEVS:datatypes")
  62.   )
  63. )
  64. (
  65.   ; Manual installation
  66.   ; Check that the storage directory exists
  67.   (if (NOT (exists "SYS:Storage/datatypes"))
  68.   (
  69.     (abort "Can't find the SYS:Storage/Datatypes directory")
  70.   ))
  71.  
  72.   ; Copy the datatype to it
  73.   (copyfiles
  74.     (prompt "")
  75.     (help @copyfiles-help)
  76.     (source "JPEG")
  77.     (infos)
  78.     (dest "SYS:Storage/Datatypes")
  79.   )
  80. ))
  81.  
  82. ; Now ask for somewhere to assign JPEGTMP:
  83. (set temp_location (askdir
  84.   (prompt "You can optionally select a location for JPEGTMP.")
  85.   (default "RAM:")
  86.   (help
  87.     (cat "Some JPEGs may require extra disk space while decoding.  JPEGTMP "
  88.          " is a assignment that will tell the datatype where it can store "
  89.          "its temporary files.  Ideally, it should be located on hard disk, "
  90.          "but you can use RAM disk if you have plenty of RAM.\n\n"
  91.          "This step is optional, but you are advised to supply a location. "
  92.     ))
  93. ))
  94.  
  95. ; If a directory was selected, put it in the user-startup file
  96. (startup "JPEG Datatype"
  97.   (prompt "Do you want the JPEGTMP assignment put in your user-startup?")
  98.   (help
  99.     (cat "You are advised to put the JPEGTMP assignment in your user-startup "
  100.          "file, otherwise you will have problems decoding certain JPEGs."
  101.   ))
  102.   (command "assign JPEGTMP: " temp_location)
  103. )
  104. ; and perform the assign
  105. (makeassign "JPEGTMP" temp_location)
  106.  
  107. ; Now exit, telling them what the situation is
  108. (if (= choice 0)
  109. (
  110.   ; Installation was permanent
  111.   (exit
  112.     (cat "You will have to reboot the system before you can use the "
  113.          "JPEG datatype."
  114.   ))
  115. )
  116. (
  117.   ; Installation was manual
  118.   (exit
  119.     (cat "You must double-click on the JPEG icon in the Storage->Datatypes "
  120.          "drawer on your Workench disk in order to use the JPEG datatype. "
  121.          "The datatype will then be available for use until you reboot."
  122.   ))
  123. ))